package cn.wx;

import java.io.ByteArrayInputStream;
import java.io.InputStream;

/**
 * @Author lyy
 * @Description TODO
 * @PACKAGE_NAME: cn.wx
 * @ClassName UserWxPayMyConfig
 * @Date 2020/6/30 11:12
 * @DAY_NAME_FULL: 星期二
 * @Version 1.0
 **/
public class UserWxPayMyConfig extends WXPayConfig {

    private byte[] certData;

    @Override
    String getAppID() {
        return "wx51d55df222d9901e";
    }

    @Override
    public String getMchID() {
        return "1550181801";
    }

    @Override
    public String getKey() {
        return "0B2DC615EA4F78BC4B216AEA1A6DA63B";
        //c8bf9f0c564f7f44a297054995e6eada
    }

    @Override
    public InputStream getCertStream() {
        ByteArrayInputStream certBis = new ByteArrayInputStream(this.certData);
        return certBis;
    }

    @Override
    public int getHttpConnectTimeoutMs() {
        return 8000;
    }

    @Override
    public int getHttpReadTimeoutMs() {
        return 10000;
    }

    @Override
    IWXPayDomain getWXPayDomain() {
        return new IWXPayDomain() {
            @Override
            public void report(String domain, long elapsedTimeMillis, Exception ex) {
            }

            @Override
            public DomainInfo getDomain(WXPayConfig config) {
                return new DomainInfo("api.mch.weixin.qq.com", false);
            }
        };
    }
}
